/**
 * 
 */
package fr.fermeManager.application.controllers;

import fr.fermeManager.application.utils.AppContext;
import fr.fermeManager.application.utils.Constantes;
import fr.fermeManager.application.views.ViewFermeSelection;
import fr.fermeManager.application.views.ViewGestionTransactions;
import fr.fermeManager.application.views.ViewGestionTypesTransactions;
import fr.fermeManager.application.views.ViewUserSelection;

/**
 * @author Mo
 *
 */
public class MenuController {
	
	public MenuController() {
		// TODO Auto-generated constructor stub
	}

	public void importerInactifs() {
		// TODO Auto-generated method stub
		
	}

	public void quitterApplication() {
		System.exit(0);
	}

	public void changerFermeSelection() {
		
		String currentUser =  (String) AppContext.getSession().get(Constantes.USER);
		
		AppContext.getSession().removeAll();
		
		AppContext.getSession().set(Constantes.USER,currentUser);
		
		// Affectation de la nouvelle vue
		AppContext.setBasePanel(new ViewFermeSelection(new ControllerFermeSelection()),false);
	}

	public void chargerGestionTypesTransactions() {
		
		AppContext.setBasePanel(new ViewGestionTypesTransactions(new ControllerGestionTypesTransactions()),false);
		
	}

	public void changerUtilisateurSelection() {
		
		AppContext.getSession().removeAll();
		
		AppContext.setBasePanel(new ViewUserSelection(new ControllerUserSelection()),false);
	}

	public void chargerFermeInformations() {
		
		AppContext.setBasePanel(new ViewGestionTransactions(new ControllerGestionTransactions()),false);
	}
}
